<?php
/**
 * Created by PhpStorm.
 * User: changyifan
 * Date: 2018/3/27
 * Time: 下午2:37
 */



function getTeaZhiByValue($var){
    switch ($var){
        case '1': return '教授'; break;
        case '2': return '副教授'; break;
        case '3': return '讲师'; break;
        case '4': return '教授'; break;
        default: return '';
    }
}
function getTeaSexByValue($var){
    switch ($var){
        case '1': return '男'; break;
        case '2': return '女'; break;
        default: return '';
    }
}
function getTeaStatusByValue($var){
    switch ($var){
        case '1': return '在职'; break;
        case '2': return '离职'; break;
        case '3': return '退休'; break;
        default: return '';
    }
}
function getStuSexByValue($var){
    switch ($var){
        case '1': return '男'; break;
        case '2': return '女'; break;
        case '男': return '男'; break;
        case '女': return '女'; break;
        default: return '';
    }
}
function getStuStatusByValue($var){
    switch ($var){
        case '1': return '正常'; break;
        case '2': return '休学'; break;
        case '3': return '退学'; break;
        case '4': return '毕业'; break;
        case '正常': return '正常'; break;
        case '休学': return '休学'; break;
        case '退学': return '退学'; break;
        case '毕业': return '毕业'; break;
        default: return '';
    }
}
function get_uuid(){
    if (function_exists('com_create_guid')){
        return com_create_guid();
    }else{
        mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
        $charid = strtoupper(md5(uniqid(rand(), true)));
        $hyphen = chr(45);// "-"
        $uuid = substr($charid, 0, 8).$hyphen
            .substr($charid, 8, 4).$hyphen
            .substr($charid,12, 4).$hyphen
            .substr($charid,16, 4).$hyphen
            .substr($charid,20,12);
        return $uuid;
    }
}
    function getTime(){
        return date('Y-m-d');
    }
    function getTcStatusNameById($id){
        switch($id){
            case '1' : return '通过';break;
            case '2' : return '等待审核';break;
            case '3' : return '未通过'; break;
            case '4' : return '注销'; break;
            default : return '';
        }
    }
    function checkoutLanName($name){
        if ($name === 0){
            return null;
        }else{
            return $name;
        }
    }
    function getCurrentTeaId(){
        $user_info = session(C('USER_AUTH_INFO'));
        return $user_info['tea_id'];
    }